In mathematics, a metric space is a set where a notion of distance (called a metric) between elements of the set is defined.
The metric space which most closely corresponds to our intuitive understanding of space is the 3-dimensional Euclidean space. In fact, the notion of "metric" is a generalization of the Euclidean metric arising from the four long-known properties of the Euclidean distance. The Euclidean metric defines the distance between two points as the length of the straight line segment connecting them.
The geometric properties of the space depend on the metric chosen, and by using a different metric we can construct interesting non-Euclidean geometries such as those used in the theory of general relativity.
A metric space also induces topological properties like open and closed sets which leads to the study of even more abstract topological spaces.
Maurice Fréchet introduced metric spaces in his work Sur quelques points du calcul fonctionnel, Rendic. Circ. Mat. Palermo 22 (1906) 1–74.
A metric space is an ordered pair where is a set and is a metric on , i.e., a function
such that for any , the following holds:
The first condition follows from the other three, since:
The function is also called distance function or simply distance. Often, is omitted and one just writes for a metric space if it is clear from the context what metric is used.
Every metric space is a topological space in a natural manner, and therefore all definitions and theorems about general topological spaces also apply to all metric spaces.
About any point in a metric space we define the open ball of radius about as the set
These open balls generate a topology on M, making it a topological space.
Explicitly, a subset of is called open if for every in there exists an such that is contained in . The complement of an open set is called closed. A neighborhood of the point is any subset of that contains an open ball about as a subset.
A topological space which can arise in this way from a metric space is called a metrizable space; see the article on metrization theorems for further details.
A sequence () in a metric space is said to converge to the limit iff for every , there exists a natural number N such that for all . Equivalently, one can use the general definition of convergence available in all topological spaces.
A subset of the metric space is closed iff every sequence in that converges to a limit in has its limit in .
A metric space is said to be complete if every Cauchy sequence converges in . That is to say: if as both and independently go to infinity, then there is some with .
Every Euclidean space is complete, as is every closed subset of a complete space. The rational numbers, using the absolute value metric , are not complete.
Every metric space has a unique (up to isometry) completion, which is a complete space that contains the given space as a dense subset. For example, the real numbers are the completion of the rationals.
If is a complete subset of the metric space , then is closed in . Indeed, a space is complete iff it is closed in any containing metric space.
Every complete metric space is a Baire space.
A metric space M is called bounded if there exists some number r, such that d(x,y) ≤ r for all x and y in M. The smallest possible such r is called the diameter of M. The space M is called precompact or totally bounded if for every r > 0 there exist finitely many open balls of radius r whose union covers M. Since the set of the centres of these balls is finite, it has finite diameter, from which it follows (using the triangle inequality) that every totally bounded space is bounded. The converse does not hold, since any infinite set can be given the discrete metric (one of the examples above) under which it is bounded and yet not totally bounded.
Note that in the context of intervals in the space of real numbers and occasionally regions in a Euclidean space Rn a bounded set is referred to as "a finite interval" or "finite region". However boundedness should not in general be confused with "finite", which refers to the number of elements, not to how far the set extends; finiteness implies boundedness, but not conversely.
A metric space M is compact if every sequence in M has a subsequence that converges to a point in M. This is known as sequential compactness and, in metric spaces (but not in general topological spaces), is equivalent to the topological notions of countable compactness and compactness defined via open covers.
Examples of compact metric spaces include the closed interval [0,1] with the absolute value metric, all metric spaces with finitely many points, and the Cantor set. Every closed subset of a compact space is itself compact.
A metric space is compact iff it is complete and totally bounded. This is known as the Heine–Borel theorem. Note that compactness depends only on the topology, while boundedness depends on the metric.
Lebesgue's number lemma states that for every open cover of a compact metric space M, there exists a "Lebesgue number" δ such that every subset of M of diameter < δ is contained in some member of the cover.
Every compact metric space is second countable,[4] and is a continuous image of the Cantor set. (The latter result is due to Pavel Alexandrov and Urysohn.)
A metric space is said to be locally compact if every point has a compact neighborhood. Euclidean spaces are locally compact, but infinite-dimensional Banach spaces are not.
A space is proper if every closed ball {y : d(x,y) ≤ r} is compact. Proper spaces are locally compact, but the converse is not true in general.
A metric space is connected if the only subsets that are both open and closed are the empty set and itself.
A metric space is path connected if for any two points there exists a continuous map with and . Every path connected space is connected, but the converse is not true in general.
There are also local versions of these definitions: locally connected spaces and locally path connected spaces.
Simply connected spaces are those that, in a certain sense, do not have "holes".
A metric space is separable space if it has a countable dense subset. Typical examples are the real numbers or any Euclidean space. For metric spaces (but not for general topological spaces) separability is equivalent to second countability and also to the Lindelöf property.
Suppose (M1,d1) and (M2,d2) are two metric spaces.
The map f:M1→M2 is continuous if it has one (and therefore all) of the following equivalent properties:
Moreover, f is continuous if and only if it is continuous on every compact subset of M1.
The image of every compact set under a continuous function is compact, and the image of every connected set under a continuous function is connected.
The map ƒ : M1 → M2 is uniformly continuous if for every ε > 0 there exists δ > 0 such that
Every uniformly continuous map ƒ : M1 → M2 is continuous. The converse is true if M1 is compact (Heine–Cantor theorem).
Uniformly continuous maps turn Cauchy sequences in M1 into Cauchy sequences in M2. For continuous maps this is generally wrong; for example, a continuous map from the open interval (0,1) onto the real line turns some Cauchy sequences into unbounded sequences.
Given a number K > 0, the map ƒ : M1 → M2 is K-Lipschitz continuous if
Every Lipschitz-continuous map is uniformly continuous, but the converse is not true in general.
If K < 1, then ƒ is called a contraction. Suppose M2 = M1 and M1 is complete. If ƒ is a contraction, then ƒ admits a unique fixed point (Banach fixed point theorem). If M1 is compact, the condition can be weakened a bit: ƒ admits a unique fixed point if
for all .
The map f:M1→M2 is an isometry if
Isometries are always injective; the image of a compact or complete set under an isometry is compact or complete, respectively. However, if the isometry is not surjective, then the image of a closed (or open) set need not be closed (or open).
The map f : M1 → M2 is a quasi-isometry if there exist constants A ≥ 1 and B ≥ 0 such that
and a constant C ≥ 0 such that every point in M2 has a distance at most C from some point in the image f(M1).
Note that a quasi-isometry is not required to be continuous. Quasi-isometries compare the "large-scale structure" of metric spaces; they find use in geometric group theory in relation to the word metric.
Given two metric spaces (M1, d1) and (M2, d2):
Metric spaces are paracompact[5] Hausdorff spaces[6] and hence normal (indeed they are perfectly normal). An important consequence is that every metric space admits partitions of unity and that every continuous real-valued function defined on a closed subset of a metric space can be extended to a continuous map on the whole space (Tietze extension theorem). It is also true that every real-valued Lipschitz-continuous map defined on a subset of a metric space can be extended to a Lipschitz-continuous map on the whole space.
Metric spaces are first countable since one can use balls with rational radius as a neighborhood base.
The metric topology on a metric space M is the coarsest topology on M relative to which the metric d is a continuous map from the product of M with itself to the non-negative real numbers.
A simple way to construct a function separating a point from a closed set (as required for a completely regular space) is to consider the distance between the point and the set. If (M,d) is a metric space, S is a subset of M and x is a point of M, we define the distance from x to S as
Then d(x, S) = 0 if and only if x belongs to the closure of S. Furthermore, we have the following generalization of the triangle inequality:
which in particular shows that the map is continuous.
Given two subsets S and T of M, we define their Hausdorff distance to be
In general, the Hausdorff distance dH(S,T) can be infinite. Two sets are close to each other in the Hausdorff distance if every element of either set is close to some element of the other set.
The Hausdorff distance dH turns the set K(M) of all non-empty compact subsets of M into a metric space. One can show that K(M) is complete if M is complete. (A different notion of convergence of compact subsets is given by the Kuratowski convergence.)
One can then define the Gromov–Hausdorff distance between any two metric spaces by considering the minimal Hausdorff distance of isometrically embedded versions of the two spaces. Using this distance, the set of all (isometry classes of) compact metric spaces becomes a metric space in its own right.
If are metric spaces, and N is the Euclidean norm on Rn, then is a metric space, where the product metric is defined by
and the induced topology agrees with the product topology. By the equivalence of norms in finite dimensions, an equivalent metric is obtained if N is the taxicab norm, a p-norm, the max norm, or any other norm which is non-decreasing as the coordinates of a positive n-tuple increase (yielding the triangle inequality).
Similarly, a countable product of metric spaces can be obtained using the following metric
An uncountable product of metric spaces need not be metrizable. For example, is not first-countable and thus isn't metrizable.
It is worth noting that in the case of a single space , the distance map (from the definition) is uniformly continuous with respect to any of the above product metrics , and in particular is continuous with respect to the product topology of .
If M is a metric space with metric d, and ~ is an equivalence relation on M, then we can endow the quotient set M/~ with the following (pseudo)metric. Given two equivalence classes [x] and [y], we define
where the infimum is taken over all finite sequences and with , , . In general this will only define a pseudometric, i.e. does not necessarily imply that . However for nice equivalence relations (e.g., those given by gluing together polyhedra along faces), it is a metric. Moreover if M is a compact space, then the induced topology on M/~ is the quotient topology.
The quotient metric d is characterized by the following universal property. If is a metric map between metric spaces (that is, for all x, y) satisfying f(x)=f(y) whenever then the induced function , given by , is a metric map
A topological space is sequential if and only if it is a quotient of a metric space.[7]
The ordered set can be seen as a category by requesting exactly one morphism if and none otherwise. By using as the tensor product and as the identity, it becomes a monoidal category . Every metric space can now be viewed as a category enriched over :
See the paper by F.W. Lawvere listed below.
With an author commentary: Enriched categories in the logic of geometry and analysis. Repr. Theory Appl. Categ. No. 1 (2002), 1–37.